How to solve this error "Return type of an Apex action method must be a PageReference. Found: visualforce.el.VisualforceArrayList "? 您所在的位置:网站首页 pagereference types How to solve this error "Return type of an Apex action method must be a PageReference. Found: visualforce.el.VisualforceArrayList "?

How to solve this error "Return type of an Apex action method must be a PageReference. Found: visualforce.el.VisualforceArrayList "?

2023-03-26 19:43| 来源: 网络整理| 查看: 265

Basically I have custom button in datail page .When i click this button,I have four picklist and checkbox in VF.I have to click atleast one picklist one checkbox .After clicking save button some records are returned based on the selection and redirect to the detail page with inserted records.When i run this in IE ,the Page is Working fine !! but when i try to run this code in Chrome and Mozila am getting error as

"Return type of an Apex action method must be a PageReference. Found: visualforce.el.VisualforceArrayList ".After choosing the picklist value ,the error was shown.

How to solve this !!

VF

Carset Network services Coach-Builder services Other services Contremarque options

Apex:

public class Rfleet_AdditionalServices_CLS { public String strCurrentRecId{get;set;} public String strOrderId{get;set;} public String strOptionVal {get;set;} public String strCarsetOption{get;set;} public string strNWservice{get;set;} public string strCBservice{get;set;} public string strOtherservice{get;set;} public string strContreOption{get;set;} public boolean boolShowSave {get;set;} public boolean boolService {get;set;} public List lstService ; public List lstAllService ; Map mapUniqueService ; public List lstCarset=new List(); public Rfleet_AdditionalServices_CLS(ApexPages.StandardController controller) { strCurrentRecId= apexPages.currentPage().getParameters().get('carSetID'); strOrderId=apexPages.currentPage().getParameters().get('orderID'); List lstValidNetwork=[select id,Rfleet_Create_Network_Mail__c from Rfleet_Car_Set__c where id=:strCurrentRecId]; for(Rfleet_Car_Set__c validNetwork: lstValidNetwork) { system.debug(''+strCarsetOption+strNWservice+strCBservice+strOtherservice+strContreOption); lstService =new List(); lstAllService =new List(); if(strNWservice=='true') { List lstSNWService=[SELECT id,Displayed_Code_Label__c,Name,Service_Type__c,Simple_service_type__c,Simple_Product__c,Code__c,Label__c,Rfleet_VAT_Rate__c,Rfleet_TTC_Amount__c,Car_Set__c,Price_HT__c,Customer_Sales_Price_HT__c,Quantity__c,Simple_Product__r.Rfleet_Active_Service__c from Service__c where Service_Type__c='Simple product' and Simple_service_type__c='Network' and Car_Set__c=:strCarsetOption]; List lstCNWService=[select id,name,Displayed_Code_Label__c,Car_Set__c from Service__c where Service_Type__c='Simple product' and Simple_service_type__c='Network' and Car_Set__r.Rfleet_Create_Network_Mail__c=true and Car_Set__c=:strCurrentRecId]; lstService =getUniqueRecords(lstCNWService,lstSNWService,boolShowSave ); system.debug('SelectedlstService Network >>>>'+lstService ); system.debug(' Network size >>>>'+lstService.size() ); lstAllService .addAll(lstService ); } if(strCBservice=='true') { List lstSCBService=[select id,name,Displayed_Code_Label__c,Service_Type__c,Rfleet_CB_Account__c,CB_Options_repository__c,CB_Services_Repository__c,Code__c,Label__c,Rfleet_VAT_Rate__c,Rfleet_TTC_Amount__c,Price_HT__c,Customer_Sales_Price_HT__c,Quantity__c,CB_Services_Repository__r.Rfleet_Active_Service__c from Service__c where Service_Type__c='Coach-Builder' and Car_Set__c=:strCarsetOption]; List lstCCBService=[select id,name,Displayed_Code_Label__c from Service__c where Service_Type__c='Coach-Builder' and Car_Set__c=:strCurrentRecId]; lstService =getUniqueRecords(lstCCBService,lstSCBService,boolService ); system.debug('SelectedlstService coachbuider>>>>'+lstService ); system.debug(' strCBservice size >>>>'+lstService.size() ); lstAllService .addAll(lstService ); } if(strContreOption=='true') { List lstSContreOption=[SELECT id,Displayed_Code_Label__c,Name,Service_Type__c,Simple_service_type__c,Simple_Product__c,Code__c,Label__c,Rfleet_VAT_Rate__c,Rfleet_TTC_Amount__c,Car_Set__c,Price_HT__c,Customer_Sales_Price_HT__c,Quantity__c,Simple_Product__r.Rfleet_Active_Service__c from Service__c where Service_Type__c='Simple product' and Simple_service_type__c='Contremarque Option' and Car_Set__c=:strCarsetOption]; List lstCContreOption=[select id,name,Displayed_Code_Label__c,Car_Set__c from Service__c where Service_Type__c='Simple product' and Simple_service_type__c='Contremarque Option' and Car_Set__c=:strCurrentRecId]; lstService =getUniqueRecords(lstCContreOption,lstSContreOption,boolService ); system.debug('SelectedlstService contramaque>>>>'+lstService ); system.debug(' strContreOptionsize >>>>'+lstService.size() ); lstAllService .addAll(lstService ); } if(strOtherservice=='true') { List lstSOthrService=[SELECT id,Displayed_Code_Label__c,Name,Service_Type__c,Simple_service_type__c,Simple_Product__c,Code__c,Label__c,Rfleet_VAT_Rate__c,Rfleet_TTC_Amount__c,Car_Set__c,Price_HT__c,Customer_Sales_Price_HT__c,Quantity__c,Simple_Product__r.Rfleet_Active_Service__c from Service__c where Service_Type__c='Simple product' and Simple_service_type__c='Other' and Car_Set__c=:strCarsetOption]; List lstCOthrService=[select id,name,Displayed_Code_Label__c,Car_Set__c from Service__c where Service_Type__c='Simple product' and Simple_service_type__c='Other' and Car_Set__c=:strCurrentRecId]; lstService =getUniqueRecords(lstCOthrService,lstSOthrService,boolService ); system.debug('SelectedlstService otherService>>>>'+lstService ); system.debug('strOtherservice size>>>>'+lstService.size() ); lstAllService .addAll(lstService ); } system.debug('final>>>>'+lstAllService ); system.debug('lstAllService size>>>>'+lstAllService .size() ); return lstAllService ; } public Pagereference saveService() { if(strCarsetOption!=null &&(strNWservice=='true'||strCBservice=='true'||strOtherservice=='true'||strContreOption=='true') ) { List lstSaveService=retrieveService(); system.debug('lstSaveService>>>>'+lstSaveService); try { if(lstSaveService.size()>0) { insert lstSaveService; system.debug('insert>>>>'+lstSaveService+lstSaveService.size()); } return new Pagereference ('/'+strCurrentRecId); } catch( Exception ex) { return null; } } else{ system.debug('The error has occured'); ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.error,'Choose atleast one picklist and checkbox value')) ; return null; } } public Pagereference cancel() { return new Pagereference ('/'+strCurrentRecId); } public List getUniqueRecords(List lstCurrentRecord,List lstSelectedRecord,Boolean boolAddService ) { system.debug('lstCurrentRecord


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有